package com.example.demo.controller;

import com.example.demo.SysDict;
import com.example.demo.service.SystemDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: SystrmDictController
 * @Author : sz
 * @Date :2024/2/29  10:34
 * @Description: TODO
 * @Version :1.0
 */
@RestController
@Api(value = "SystemDictController", tags = "系统字典查询")
public class SystemDictController {

    @Autowired
    private SystemDictService systemDictService;

    @GetMapping("/getDetailById")
    @ApiOperation(value = "根据id查询字典信息", tags = "字典表管理", notes = "查询具体的分页")
    public  SysDict getDetailById(String id){
        SysDict sysDict = systemDictService.getDetailById(id);
        return sysDict;
    }

    @GetMapping("/getAll")
    @ApiOperation(value = "查询所有的配置项", tags = "字典表管理", notes = "查询所有的配置项")
    public List<SysDict> getAll(){
        List<SysDict> sysDictList = systemDictService.getAll();
        return sysDictList;
    }
}
